<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ForumPostStore extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
        'sort_id'=>'required|numeric',
        'title'=>'required|max:191',
        'image'=>'max:1000',
        ];
    }
    public function messages()
    {
        return [
            'sort_id.required'=>'请正确选择帖子分类',
            'sort_id.numeric'=>'请正确选择帖子分类',
            'title.required'=>'请输入标题',
            'title.max'=>'标题过长',
            'image.max'=>'最多可上传9张图片',
        ];
    }
}
